import { Controller, Get, Post, Param } from '@nestjs/common';

import { UsersService } from './users.service'

@Controller('users')
export class UsersController {

  constructor(private readonly usersService: UsersService) {}
  @Post()
  create(): string {
    return 'This action adds a new cat';
  }

  @Get("test")
  findAll(): any {
    //return 'This action returns all cats';
    return this.usersService.findAll()
  }
  /*@Get()
  async findAll(): Promise<any[]> {
    return [];
  }*/

  /*@Post()
  async create(@Body() createCatDto: CreateCatDto) {
    return 'This action adds a new cat';
  }*/

  /*@Put(':id')
  update(@Param('id') id: string, @Body() updateCatDto: UpdateCatDto) {
    return `This action updates a #${id} cat`;
  }*/


  @Get(':id')
  findOne(@Param('id') id: number): any {
    return this.usersService.findOne(id);
  }



  @Get(':id')
  findOne1(@Param() params: any): string {
    console.log(params.id);
    return `This action returns a #${params.id} cat`;
  }

}